import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-10-20
 * Time: 18:52
 */
public class Exam1019 {
    public static boolean Judge(int i) {
        int sum = 1;
        for (int j = 2; j <= Math.sqrt(i); j++) {
            if(i % j == 0) {
                if(i / j == j) {
                    sum += j;
                } else {
                    sum += j;
                    sum += i / j;
                }
            }
        }
        if(i == sum) {
            return true;
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        for (int i = 3; i <= n; i++) {
            if(Judge(i)) {
                count++;
            }
        }
        System.out.println(count);
//        Judge(28);
    }
}
